package com.kgc.scd.bean;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * sign
 * @author 
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Sign implements Serializable {
    /**
     * 自增id
     */
    private Integer signId;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 签到时间
     */
    private Date signdate;

    /**
     * 年
     */
    private Integer signYear;

    /**
     * 月
     */
    private Integer signMonth;

    /**
     * 日
     */
    private Integer signDay;

    private static final long serialVersionUID = 1L;

    public Integer getSignId() {
        return signId;
    }

    public void setSignId(Integer signId) {
        this.signId = signId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getSigndate() {
        return signdate;
    }

    public void setSigndate(Date signdate) {
        this.signdate = signdate;
    }

    public Integer getSignYear() {
        return signYear;
    }

    public void setSignYear(Integer signYear) {
        this.signYear = signYear;
    }

    public Integer getSignMonth() {
        return signMonth;
    }

    public void setSignMonth(Integer signMonth) {
        this.signMonth = signMonth;
    }

    public Integer getSignDay() {
        return signDay;
    }

    public void setSignDay(Integer signDay) {
        this.signDay = signDay;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Sign other = (Sign) that;
        return (this.getSignId() == null ? other.getSignId() == null : this.getSignId().equals(other.getSignId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getSigndate() == null ? other.getSigndate() == null : this.getSigndate().equals(other.getSigndate()))
            && (this.getSignYear() == null ? other.getSignYear() == null : this.getSignYear().equals(other.getSignYear()))
            && (this.getSignMonth() == null ? other.getSignMonth() == null : this.getSignMonth().equals(other.getSignMonth()))
            && (this.getSignDay() == null ? other.getSignDay() == null : this.getSignDay().equals(other.getSignDay()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSignId() == null) ? 0 : getSignId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getSigndate() == null) ? 0 : getSigndate().hashCode());
        result = prime * result + ((getSignYear() == null) ? 0 : getSignYear().hashCode());
        result = prime * result + ((getSignMonth() == null) ? 0 : getSignMonth().hashCode());
        result = prime * result + ((getSignDay() == null) ? 0 : getSignDay().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", signId=").append(signId);
        sb.append(", userId=").append(userId);
        sb.append(", signdate=").append(signdate);
        sb.append(", signYear=").append(signYear);
        sb.append(", signMonth=").append(signMonth);
        sb.append(", signDay=").append(signDay);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}